import './assets/main.css'
import './assets/theme.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'

import ElementPlus from 'element-plus' // 引入element-plus
import zhCn from 'element-plus/es/locale/lang/zh-cn' // 引入中文语言包
import * as ElementPlusIconsVue from '@element-plus/icons-vue' // 引入element-plus图标库
// import 'element-plus/theme-chalk/display.css'// 基于断点的隐藏类样式

//自定义指令引入
import clickOutsideDirective from './utils/directives/clickOutside.ts';


// 自定义icon组件
import 'virtual:svg-icons-register';
import SvgIcon from '@/components/Svgicon/index.vue'

import App from './App.vue'
import router from './router'

const app = createApp(App)
app.directive('click-outside', clickOutsideDirective)// 注册自定义指令
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)// 注册element-plus图标库
}
// 注册element-plus
app.use(ElementPlus, {
  locale: zhCn
})
app.use(createPinia())
app.use(router)
app.component('SvgIcon', SvgIcon)

app.mount('#app')
